<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Reaction game!</title>

  <!-- Bootstrap -->
  <link href="css/bootstrap.min.css" rel="stylesheet">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
  <style type="text/css">

  .contentContainer {
    margin-left: auto;
    margin-right: auto;
  }

  #topContainer {
    background-image: url("day-dream-1600.jpg");
    width: 100%;
    background-size: cover;
  }

  .bold {
    font-weight:bold;
  }

  .center {
    text-align: center;
  }

  #topBar {
    background-color: rgb(102,204,255);
  }

  #gameBoard {
    background-color: white;
  }
  </style>
</head>

<body>

  <div class="container contentContainer" id="topContainer">

    <div id="topBar" class="row center">
      <div class="col-md-6 col-md-offset-3">
        <h1 class="bold">Reaction challenge!</h1>
      </div>
    </div>

    <div id="gameBoard">

    </div>

  </div>

  <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <!-- Include all compiled plugins (below), or include individual files as needed -->
  <script src="js/bootstrap.min.js"></script>

  <script type="text/javascript">
    var winHeight=$(window).height();
    $(".contentContainer").css("height", winHeight);

    var winWidth=$(window).width();

    var boxSize=Math.min(winHeight, winWidth) / 1.4;

    $("#gameBoard").css("height", boxSize);
    $("#gameBoard").css("width", boxSize);
    $("#gameBoard").css("borderRadius", boxSize/10);

    jQuery.fn.center = function () {
      this.css("position","absolute");
      this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + 
        $(window).scrollTop()) + "px");
      this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + 
        $(window).scrollLeft()) + "px");
      return this;
    }

    $("#gameBoard").center();

  </script>
</body>

</html>
